package com.team.equ.bean;

import com.alibaba.fastjson.JSONObject;
import lombok.Data;

/**
 * @author KonYan
 * @create 2021-07-16 20:02
 */
@Data
public class Msg {

    private JSONObject result = new JSONObject();

    public static Msg success(){
        Msg result = new Msg();
        result.getResult().put("code",100);
        result.getResult().put("msg","处理成功！");

        return result;
    }

    public static Msg fail(){
        Msg result = new Msg();
        result.getResult().put("code",200);
        result.getResult().put("msg","处理失败！");

        return result;
    }

    public Msg add(String key,Object value) {
        this.getResult().put(key,value);
        return this;
    }
}
